var longestCommonPrefix = function(strs) {
    if(!strs.length) {
        return ""
    }
    var res = ""
    var str1 = strs[0]
    var l1 = str1.length
    var l2 = strs.length
    for(var i = 0; i < l1; i++){
        for(var j = 1; j < l2; j++){
          if(str1[i] !== strs[j][i])
          {
              return res
          } 
        }
        res += str1[i]
    }
    return res
    };